﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            Test();
        }
        public static void Test()
        {
            try
            {
                //ArrayList s1 = new ArrayList();
                int[] arr = new int[5];
                for (int i = 0; i < arr.Length; i++)
                {
                    Console.WriteLine("请输入成绩：");
                    double num = double.Parse(Console.ReadLine());
                    //double sum = 0;
                }
                Console.WriteLine("学生总数为：" + arr.Length);
                double sum = 0;
                for (int i = 0; i < arr.Length; i++)
                {
                    sum = sum + i;
                    Console.WriteLine("总分数为：" + sum);
                }

                double avg = sum / arr.Length;
                Console.WriteLine("平均分为：" + avg);
            }
            catch (FormatException e)
            {

                Console.WriteLine("异常已处理");
            }
            catch (OverflowException o)
            {
                Console.WriteLine("异常已处理");
            }
            catch (Exception e)
            {
                Console.WriteLine("异常已处理");
            }
            finally
            {
                Console.WriteLine("异常已处理");
            }
        }
    }
}
